package com.gtt.pattern.creational.prototype;

/**
 * Client
 * 
 * @author Michael(gao12581@sina.com)
 * @date 2011-2-25 12:46:56
 * 
 */
public class Client {

    public static void main(String[] args) throws Exception {
        DogClone dogClone = new DogClone();
        dogClone.setLegCounts(3);

        System.out.println("原来的克隆狗的腿数量:" + dogClone.toString());
        System.out.println("原来的普通狗的腿数量:" + dogClone.getDog().toString());

        DogClone dogClone1 = (DogClone) dogClone.clone();
        dogClone1.setLegCounts(2);
        dogClone1.getDog().changeLegCounts();

        System.out.println("克隆后原来的克隆狗的腿数量:" + dogClone.toString());
        System.out.println("克隆后原来的普通狗的腿数量:" + dogClone.getDog().toString());

        System.out.println("克隆后的克隆狗的腿数量:" + dogClone1.toString());
        System.out.println("克隆后的普通狗的腿数量:" + dogClone1.getDog().toString());

    }

}
